<?php
/**
 * Created by Command.
 * User: Vito
 */

declare (strict_types = 1);

namespace app\admin\controller\v1;

use app\admin\controller\BaseController;
use app\logic\WaterEleRecordLogic;


class WaterEleRecord extends BaseController
{
    protected $name = '水电记录';

    protected $registerCurd = true;

    protected $registerCurdDir = true;
    protected $methodName = [
        'getWaterEle'             => '获取上次水电表读数',
    ];

    /**
     * 初始化
     */
    protected function initialize()
    {
        $this->logic = new WaterEleRecordLogic();
    }

    /**
     * @Description: 获取上次水电记录
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-23 17:32:44
     * @version: 1.0.0
     * @return [type]
     */
    public function getWaterEle(){

        $params = $this->request->get();


        $res = $this->logic->getWaterEle($params);

        if ($res) {
            return success($res, '获取成功');
        } else {
            return success($res, '暂无读数');
        }

    }

}
